/*
Replication Do File for Appendix:

Hye Ryeon Jang and Benjamin Smith (2021) "Pax Petrolica? 
	Rethinking the Oil-Interstate War Linkage"

Data generated using Stata 16 
*/ 


********************************************************************************
*** 						APPENDIX A. Fixed Effects                        ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

********************************************************************************
***          TABLE A1. Poisson Regression Analysis with Fixed Effects:       ***
***                    Alternative Measurement of Petrostate                 ***
********************************************************************************

eststo clear

eststo, ti("Model A1.1"): xtpoisson revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity /// 
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

eststo, ti("Model A1.2"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

eststo, ti("Model A1.3"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_20 i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table A1: Poisson Regression Analysis with Fixed Effects: Alternative Measurement of Petrostate")


********************************************************************************
***          TABLE A2. Poisson Regression Analysis with Fixed Effects:       ***
***        Continuous Measurement of Petrostate with Different Timelines     ***
********************************************************************************

eststo clear

eststo, ti("Model A2.1"): xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar ///
peaceyearsp1-peaceyearsp3 if revonsets<10, fe

eststo, ti("Model A2.2"): xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

eststo, ti("Model A2.3"): xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 2002, fe

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table A2: Poisson Regression Analysis with Fixed Effects: Continuous Measurement of Petrostate with Different Timelines")


********************************************************************************
***          TABLE A3. Poisson Regression Analysis with Fixed Effects:       ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
********************************************************************************

eststo clear

eststo, ti("Model A3.1"): xtpoisson revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders coldwar iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10, fe

eststo, ti("Model A3.2"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10, fe

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model A3.3"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table A3: Poisson Regression Analysis with Fixed Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988)")


********************************************************************************
***          TABLE A4. Poisson Regression Analysis with Fixed Effects:       ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
***			 		   with Restricted Time Span (1945-1990)                 ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

eststo clear

eststo, ti("Model A4.1"): xtpoisson revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

eststo, ti("Model A4.2"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model A4.3"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table A4: Poisson Regression Analysis with Fixed Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988) with Restricted Time Span (1945-1990)") 

	
********************************************************************************
***        FIGURE A1. Effect of Oil and Gas Income per capita on MIDs        ***
***                   by Revolutionary and Non-revolutionary Leaders         ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 2002, fe

margins revolutionaryleader, at(logoil=(-7(2)12)) atmeans
marginsplot, recast(line) recastci(rarea) ///
ytitle(Expected Logged Counts of MIDs per year) ///
xtitle(Logged Oil & Gas Income per capita) xlabel(-7(2)12)


********************************************************************************
*** 			APPENDIX B. Negative Binomial Regression Analysis            ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

********************************************************************************
***    TABLE B1. Negative Binomial Regression Analysis with Random Effects:  ***
***                    Alternative Measurement of Petrostate                 ***
********************************************************************************

eststo clear

eststo, ti("Model B1.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.158071 

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.086591

eststo, ti("Model B1.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.124553

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.059587 

eststo, ti("Model B1.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_20 i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity ///
borders coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.petrostate_20 ///
i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.113802

glm revonsets i.revolutionaryleader i.petrostate_20 ///
i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.053848

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B1: Negative Binomial Regression Analysis with Random Effects: Alternative Measurement of Petrostate")
	

********************************************************************************
***    TABLE B2. Negative Binomial Regression Analysis with Random Effects:  ***
***        Continuous Measurement of Petrostate with Different Timelines     ***
********************************************************************************

eststo clear

eststo, ti("Model B2.1"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar muslim ///
major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.142219

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.07444 

eststo, ti("Model B2.2"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders muslim major ///
i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
muslim major i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10 & year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.091893 

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
muslim major i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10 & year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: .9977718 

eststo, ti("Model B2.3"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar muslim ///
major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 2002

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 2002, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.156298 

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 2002, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.069748

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B2: Negative Binomial Regression Analysis with Random Effects: Continuous Measurement of Petrostate with Different Timelines")

	
********************************************************************************
***   TABLE B3. Negative Binomial Regression Analysis with Random Effects:   ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
********************************************************************************

eststo clear

eststo, ti("Model B3.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders coldwar muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.131865 

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.086762 

eststo, ti("Model B3.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.101663

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.058423

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model B3.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.099223 

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.063456 

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B3: Negative Binomial Regression Analysis with Random Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988)")
	
	
********************************************************************************
***    TABLE B4. Negative Binomial Regression Analysis with Random Effects:  ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
***			 		   with Restricted Time Span (1945-1990)                 ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

eststo clear

eststo, ti("Model B4.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.096718 

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: 1.040222

eststo, ti("Model B4.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.052933 

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: .991561

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model B4.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders muslim major i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: 1.04871

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: .9970621

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B4: Negative Binomial Regression Analysis with Random Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988) with Restricted Time Span (1945-1990)") 

	
********************************************************************************
***    TABLE B5. Negative Binomial Regression Analysis with Fixed Effects:   ***
***                    Alternative Measurement of Petrostate                 ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

tabulate ccode, generate(country_dummy)

eststo clear

eststo, ti("Model B5.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: .8989301 

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge  

eststo, ti("Model B5.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

eststo, ti("Model B5.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_20 i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe 

glm revonsets i.revolutionaryleader i.petrostate_20 ///
i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_20 ///
i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B5: Negative Binomial Regression Analysis with Fixed Effects: Alternative Measurement of Petrostate")

	
********************************************************************************
***    TABLE B6. Negative Binomial Regression Analysis with Fixed Effects:   ***
***        Continuous Measurement of Petrostate with Different Timelines     ***
********************************************************************************	

eststo clear

eststo, ti("Model B6.1"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar ///
peaceyearsp1-peaceyearsp3 if revonsets<10, fe 

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10, ///
fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

eststo, ti("Model B6.2"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10 & year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10 & year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

eststo, ti("Model B6.3"): xtnbreg revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 2002, fe

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 2002, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

glm revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 2002, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B6: Negative Binomial Regression Analysis with Fixed Effects: Continuous Measurement of Petrostate with Different Timelines")


********************************************************************************
***   TABLE B7. Negative Binomial Regression Analysis with Fixed Effects:    ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
********************************************************************************

eststo clear

eststo, ti("Model B7.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders coldwar iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10, fe
*** Unable to Converge

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

eststo, ti("Model B7.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10, fe
*** Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model B7.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar peaceyearsp1-peaceyearsp3 if revonsets<10, fe

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar peaceyearsp1-peaceyearsp3 country_dummy* ///
if revonsets<10, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B7: Negative Binomial Regression Analysis with Fixed Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988)")


********************************************************************************
***    TABLE B8. Negative Binomial Regression Analysis with Fixed Effects:   ***
***          Impact of Influential Cases: The Iran-Iraq War (1980-1988)      ***
***			 		   with Restricted Time Span (1945-1990)                 ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

eststo clear

eststo, ti("Model B8.1"): xtnbreg revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe
*** Unable to Converge

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

eststo, ti("Model B8.2"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders iraniraq88 peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
iraniraq88 peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model B8.3"): xtnbreg revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991, fe

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(poi) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge 

glm revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
peaceyearsp1-peaceyearsp3 country_dummy* if revonsets<10 ///
& year < 1991, fam(nb ml) cluster(ccode) 
*** The Pearson dispersion statistic: Unable to Converge

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table B8: Negative Binomial Regression Analysis with Fixed Effects: Impact of Influential Cases: The Iran-Iraq War (1980-1988) with Restricted Time Span (1945-1990)") 


********************************************************************************
*** 				     APPENDIX C. The Iran-Iraq War                       ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

********************************************************************************
*** 	     Figure C3.1. Studentized Deviance Residuals (Model 10)          ***
********************************************************************************

glm revonsets i.revolutionaryleader i.new_oil_state ///
i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity borders ///
coldwar muslim major iraniraq88 i.regnum peaceyearsp1-peaceyearsp3  ///
if revonsets<10, family(poisson) link(log) cluster(ccode)

predict fitted_g
predict res_dg, deviance studentized
separate res_dg, by(iraniraq88)

two scatter res_dg0 res_dg1 fitted, ytitle("Studentized Deviance Residuals") ///
xtitle("Predicted Mean Counts of MIDs per Year") legend(rows(3)) ///
legend(ring(0) position(5)) scheme(s1mono)


********************************************************************************
*** 				  APPENDIX D. Oil Geography Analysis                     ***
********************************************************************************

use "Casellietal_with_IIW.dta", clear

global benchmark_controls "surfacemean surfacediff popmean popdiff cgdpmean cgdpdiff politymean politydiff CW1 CW2 capabmean capabdiff bi_trade_GDP alliance_1 opec1 opec2 fst_distance_dominant_wacz colony_mayer smctry_mayer iraniraq88"
global controls "$benchmark_controls peacedur_hostil45"
global controls_war "$benchmark_controls peacedur_hostil5"
global controls_ho345 "$benchmark_controls peacedur_hostil345"
global controls_tc "$benchmark_controls peacedur_tcdummy"

global method "regress"
global cluster1 ", r cl(dyadid)"

********************************************************************************
***               TABLE D1. Baseline Results for Hostility                   ***
********************************************************************************

eststo clear

eststo, ti("Model D1.1"): $method lead1hostil45 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls td* $cluster1

eststo, ti("Model D1.2"): $method lead1hostil45 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls fe* td* $cluster1

eststo, ti("Model D1.3"): $method lead1hostil45 Ioff1 fmin_Ioff1 Ioff2 ///
fmin_Ioff2 fmax_Ioff2 $controls td* $cluster1

eststo, ti("Model D1.4"): $method lead1hostil45 Ioff1 fmin_Ioff1 Ioff2 ///
fmin_Ioff2 fmax_Ioff2 $controls fe* td* $cluster1

eststo, ti("Model D1.5"): $method lead1hostil45 Ion1 fmin_Ion1 Ion2 ///
fmin_Ion2 fmax_Ion2 $controls td* $cluster1

eststo, ti("Model D1.6"): $method lead1hostil45 Ion1 fmin_Ion1 Ion2 /// 
fmin_Ion2 fmax_Ion2 $controls fe* td* $cluster1

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N r2 aic bic, labels(Observations R-Squared AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table D1: Baseline Results for Hostility") 


********************************************************************************
***       TABLE D2. Baseline Results for Alternative Dependent Variables     ***
********************************************************************************

eststo clear

eststo, ti("Model D2.1"): $method lead1hostil5 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls_war td* $cluster1

eststo, ti("Model D2.2"): $method lead1hostil5 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls_war fe* td* $cluster1

eststo, ti("Model D2.3"): $method lead1hostil345 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls_ho345 td* $cluster1

eststo, ti("Model D2.4"): $method lead1hostil345 Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls_ho345 fe* td* $cluster1

eststo, ti("Model D2.5"): poisson lead1hihost_maoz Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls td* $cluster1

eststo, ti("Model D2.6"): poisson lead1hihost_maoz Iall1 fmin_Iall1 Iall2 ///
fmin_Iall2 fmax_Iall2 $controls fe* td* $cluster1

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N r2 aic bic, labels(Observations R-Squared AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table D2: Baseline Results for Alternative Dependent Variables") 
	

********************************************************************************
*** 				  APPENDIX E. Additional Robustness Tests                ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

********************************************************************************
***             TABLE E1. Alternative Measurements of Petrostates            ***
********************************************************************************

eststo clear

eststo, ti("Model E1.1"): xtpoisson revonsets i.revolutionaryleader i.petrostate_10 ///
i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

eststo, ti("Model E1.2"): xtpoisson revonsets i.revolutionaryleader i.petrostate_20 ///
i.revolutionaryleader#i.petrostate_20 ln_gdppc lnpop polity borders ///
coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E1: Alternative Measurements of Petrostates") 


********************************************************************************
*** TABLE E2. Continuous Measurement of Petrostate with Different Timelines  ***
********************************************************************************

eststo clear

eststo, ti("Model E2.1"): xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders ///
muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

eststo, ti("Model E2.2"): xtpoisson revonsets i.revolutionaryleader c.logoil ///
i.revolutionaryleader#c.logoil ln_gdppc lnpop polity borders coldwar muslim ///
major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 2002

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E2: Continuous Measurement of Petrostate with Different Timelines") 
	

********************************************************************************
***   TABLE E3. Impact of Influential Cases: The Iran-Iraq War (1980-1988)   ***
********************************************************************************

eststo clear

eststo, ti("Model E3.1"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model E3.2"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders coldwar muslim major i.regnum peaceyearsp1-peaceyearsp3 if revonsets<10

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E3: Impact of Influential Cases: The Iran-Iraq War (1980-1988)") 


********************************************************************************
***   TABLE E4. Impact of Influential Cases: The Iran-Iraq War (1980-1988)   ***
***             with Restricted Time Span (1945-1990)                        ***
********************************************************************************

use "PaxPetrolica_Main.dta", clear

eststo clear

eststo, ti("Model E4.1"): xtpoisson revonsets i.revolutionaryleader ///
i.new_oil_state i.revolutionaryleader#i.new_oil_state ln_gdppc lnpop polity ///
borders muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

eststo, ti("Model E4.2"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders muslim major iraniraq88 i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

*** DO NOT SAVE
drop if ccode == 630 & year == 1980
drop if ccode == 630 & year == 1981
drop if ccode == 630 & year == 1982
drop if ccode == 630 & year == 1983
drop if ccode == 630 & year == 1984
drop if ccode == 630 & year == 1985
drop if ccode == 630 & year == 1986
drop if ccode == 630 & year == 1987
drop if ccode == 630 & year == 1988
drop if ccode == 645 & year == 1980
drop if ccode == 645 & year == 1981
drop if ccode == 645 & year == 1982
drop if ccode == 645 & year == 1983
drop if ccode == 645 & year == 1984
drop if ccode == 645 & year == 1985
drop if ccode == 645 & year == 1986
drop if ccode == 645 & year == 1987
drop if ccode == 645 & year == 1988

eststo, ti("Model E4.3"): xtpoisson revonsets i.revolutionaryleader ///
i.petrostate_10 i.revolutionaryleader#i.petrostate_10 ln_gdppc lnpop polity ///
borders muslim major i.regnum ///
peaceyearsp1-peaceyearsp3 if revonsets<10 & year < 1991

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E4: Impact of Influential Cases: The Iran-Iraq War (1980-1988) with Restricted Time Span (1945-1990)") 
	
	
********************************************************************************
*** TABLE E5. Monadic Fixed Effects Negative Binomial & Poisson Estimates of ***
***     Oil Price Effects on Militarized Interstate Disputes, 1947–2001      ***
********************************************************************************

use "Hendrix_Monadic_with_IIW.dta", clear

eststo clear

eststo, ti("Model E5.1"): nbreg f.onsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 country_dummy* , cluster(ccode)

eststo, ti("Model E5.2"): nbreg f.revonsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 country_dummy* , cluster(ccode)

eststo, ti("Model E5.3"): poisson f.onsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 country_dummy* , cluster(ccode)

eststo, ti("Model E5.4"): poisson f.revonsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 country_dummy* , cluster(ccode)

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E5: Monadic Fixed Effects Negative Binomial & Poisson Estimates of Oil Price Effects on Militarized Interstate Disputes, 1947–2001") 
	

********************************************************************************
*** TABLE E6. Monadic Fixed Effects Negative Binomial & Poisson Estimates of ***
***     Oil Price Effects on Militarized Interstate Disputes, 1947–2001      ***
***     without Country-Fixed Effect                                         ***
********************************************************************************

eststo clear

eststo, ti("Model E6.1"): nbreg f.onsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 , cluster(ccode)

eststo, ti("Model E6.2"): nbreg f.revonsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 , cluster(ccode)

eststo, ti("Model E6.3"): poisson f.onsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 , cluster(ccode)

eststo, ti("Model E6.4"): poisson f.revonsets realoil_08 radicalleader ///
realoil_revleader_update oil_state revleader_oilstate realoil_oilstate_update ///
realoil_revleader_oilstate majorpower coldwar ln_pop ln_gdp_combo polity ///
iraniraq88 peaceyears peaceyears_2 peaceyears_3 , cluster(ccode)

estout _all, ///
	cells(b(star fmt(3)) se(par(`"="("'`")""'))) ///
	stats(N aic bic, labels(Observations AIC BIC)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) label varlabels(_cons Constant) ///
	legend ti("Table E6: Monadic Fixed Effects Negative Binomial & Poisson Estimates of Oil Price Effects on Militarized Interstate Disputes, 1947–2001, without Country-Fixed Effect") 

